module Rispy
	def cons(a, b)
		lambda {|selector| selector.call(a, b)}
	end
	
	def car(list)
		list.call(lambda{|a, b| a})
	end
	
	def cdr(list)
		list.call(lambda{|a, b| b})
	end	
	
	def list(*items)
		items.reverse.inject(nil) {|sublist, item| cons(item, sublist)}
	end
end	